<script type="text/javascript">
function set_thumbnail_is_display(o_status) {
    if (o_status.value == 0) {
        $('#thunmbnail_setting').hide();
    } else {
        $('#thunmbnail_setting').show();
    }
}

function set_watermark_is_display(o_status) {
    if (o_status.checked) {
        $('#watermark_setting').show();
    } else {
        $('#watermark_setting').hide();
    }
}
</script>
<div id="content">
<form action="" id="settings" method="post">
    <table>
      <tbody>
        <tr>
          <th><?php __e('Thumbnail setting'); ?></th>
          <td>
            <ul><li><?php echo $html->radio('Options/thumbnail_status', array('value'=>0, 'id'=>'status_no_use', 'onclick'=>'set_thumbnail_is_display(this);')); ?> <label for="status_no_use"><?php __e('Inactive thunbnail'); ?></lable></li>
                <li><?php echo $html->radio('Options/thumbnail_status', array('value'=>1, 'id'=>'status_1', 'onclick'=>'set_thumbnail_is_display(this);')); ?> <label for="status_1"><?php __e('Make thumbnail in setting image size range'); ?></lable></li>
                <li><?php echo $html->radio('Options/thumbnail_status', array('value'=>2, 'id'=>'status_2', 'onclick'=>'set_thumbnail_is_display(this);')); ?> <label for="status_2"><?php __e('Make thumbnail in setting image size'); ?></lable></li>
            </ul>
            <table id="thunmbnail_setting" style="<?php echo $thumbnail_display_style; ?>">
                <tbody>
                <tr class="finalrow">
                <th><?php __e('Quality'); ?></th>
                <td><?php echo $html->input('Options/thumbnail_quality'); ?> <span class="u"><?php __e('Set the Thunbmail quality, the range is 0~100(integer),the number more big, the quality more better, but the size is more big.'); ?></span></td>
                </tr>
                <tr class="finalrow">
                <th><?php __e('Image Size'); ?></th>
                <td><?php echo $html->input('Options/thumbnail_width'); ?> X 
                    <?php echo $html->input('Options/thumbnail_height'); ?> <span class="u"><?php __e('(width x height) If the image size smaller then this setting, Thubnail won&#8217;t be create.'); ?></span></td>
                </tr>
                </tbody>
            </table>
        </td>
        </tr>

        <tr>
          <th><?php __e('Watermark'); ?></th>

          <td>
               <table>
                    <tbody>
                    <tr class="finalrow">
                    <th><?php __e('Use watermark'); ?></th>
                    <td><?php echo $html->checkbox('Options/is_watermark', array('value'=>1, 'onclick'=>'set_watermark_is_display(this);')); ?></td>
                    </tr>
                    </tbody>
               </table>
               <div style="<?php echo $watermark_display_style; ?>" id="watermark_setting">
<?php
if (!$watermark_file_exists) {
?>
           <?php __e('Set watermark source file, only gif format name "watermark.gif", and put it in "/www/watermark.gif", I need this before we can get started.'); ?>
<?php
} else {
?>
                <table>
                    <tbody>
                    <tr class="finalrow">
                    <th><?php __e('Watermark position'); ?></th>
                    <td>
                        <div class="watermark_position">
                        <ul>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'top_left', 'id'=>'position_top_left')); ?> <label for="position_top_left"><?php __e('top left'); ?></lable></li>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'top_center', 'id'=>'position_top_center')); ?> <label for="position_top_center"><?php __e('top center'); ?></li>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'top_right', 'id'=>'position_top_right')); ?> <label for="position_top_right"><?php __e('top right'); ?></li>
                        </ul>
                        </div>
                        <div class="watermark_position">
                        <ul>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'middle_left', 'id'=>'position_middle_left')); ?> <label for="position_middle_left"><?php __e('middle left'); ?></li>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'middle_center', 'id'=>'position_middle_center')); ?> <label for="position_middle_center"><?php __e('middle center'); ?></li>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'middle_right', 'id'=>'position_middle_right')); ?> <label for="position_middle_right"><?php __e('middle right'); ?></li>
                        </ul>
                        </div>
                        <div class="watermark_position">
                        <ul>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'bottom_left', 'id'=>'position_bottom_left')); ?> <label for="position_bottom_left"><?php __e('bottom left'); ?></li>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'bottom_center', 'id'=>'position_bottom_center')); ?> <label for="position_bottom_center"><?php __e('bottom center'); ?></li>
                            <li><?php echo $html->radio('Options/watermark_position', array('value'=>'bottom_right', 'id'=>'position_bottom_right')); ?> <label for="position_bottom_right"><?php __e('bottom right'); ?></li>
                        </ul>
                        </div>

                        </td>
                    </tr>
                    <tr class="finalrow">
                    <th><?php __e('Watermark add condition'); ?></th>
                    <td><?php echo $html->input('Options/watermark_condition_width'); ?> X 
                    <?php echo $html->input('Options/watermark_condition_height'); ?> <span class="u"><?php __e('If the image size smaller then the watermark, the watermark won&#8217;t be add, if 0 size use the watermark.'); ?></span></td>
                    </tr>
                    <tr class="finalrow">
                    <th><?php __e('Watermark transparent'); ?></th>
                    <td><?php echo $html->input('Options/watermark_transparent'); ?></td>
                    </tr>
                    </tbody>
                </table>
<?php
}
?>
                </div>
          </td>
        </tr>
        <tr class="finalrow">
          <th></th>
          <td><input value="<?php __e('Update options'); ?>" type="submit">
          </td>
        </tr>
      </tbody>
    </table>

  </form>
</div>
